package com.ssy.lingxi.transaction.controller.pc;

import com.ssy.lingxi.common.controller.BaseController;
import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.transaction.api.dto.request.InquiryListDetailsRequest;
import com.ssy.lingxi.transaction.api.dto.request.InquiryListRequest;
import com.ssy.lingxi.transaction.api.dto.response.InquiryListDetailsResponse;
import com.ssy.lingxi.transaction.api.dto.response.InquiryListResponse;
import com.ssy.lingxi.transaction.service.IPlatformInquiryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @menu 平台后台-询价单管理
 * @author wrc
 * @date 2020/7/21
 */
@RestController
@RequestMapping("/transaction")
public class PlatformInquiryController extends BaseController {

    @Resource
    IPlatformInquiryService platformInquiryService;

    /**
     *询价单管理-询价单列表查询
     */
    @GetMapping("/platform/inquiry/list")
    public Wrapper<PageData<InquiryListResponse>> inquiryList(InquiryListRequest request, HttpServletRequest httpServletRequest) {
        UserLoginCacheDTO sysUser = this.getSysUser(httpServletRequest);
        return platformInquiryService.inquiryList(request,sysUser);
    }

    /**
     * 询价单管理-询价单详情
     */
    @GetMapping("/platform/inquiry/list/details")
    public Wrapper<InquiryListDetailsResponse> inquiryListDetails(InquiryListDetailsRequest request) {
        return platformInquiryService.inquiryListDetails(request);
    }
}
